﻿using iMES.Entity.SystemModels;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace iMES.Entity.DomainModels
{
    [Entity(TableCnName = "来料检验单", TableName = "Mass_Incoming", DetailTable = new Type[] { typeof(Mass_Incoming_DetItems) }, DetailTableCnName = "来料检验单-检验项", DBServer = "SysDbContext")]
    //[Entity(TableCnName = "来料检验单", TableName = "Mass_Incoming", DBServer = "SysDbContext")]
    public partial class Mass_Incoming : SysEntity
    {
        /// <summary>
        /// 来料检验单主键
        /// </summary>
        [Key]
        [Display(Name = "来料检验单主键")]
        [Column(TypeName = "int")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public int Mass_Incoming_ID { get; set; }

        /// <summary>
        /// 检验单名称
        /// </summary>
        [Display(Name = "检验单名称")]
        [MaxLength(100)]
        [Column(TypeName = "nvarchar(100)")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public string Mass_Incoming_Name { get; set; }

        /// <summary>
        /// 检验单编码
        /// </summary>
        [Display(Name = "检验单编码")]
        [MaxLength(100)]
        [Column(TypeName = "varchar(100)")]
        [Editable(true)]
        public string Mass_Incoming_Code { get; set; }

        /// <summary>
        /// 产品
        /// </summary>
        [Display(Name = "产品")]
        [Column(TypeName = "int")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public int? Mass_Incoming_ProID { get; set; }

        /// <summary>
        /// 产品名称
        /// </summary>
        [Display(Name = "产品名称")]
        [MaxLength(100)]
        [Column(TypeName = "nvarchar(100)")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public string Mass_Incoming_ProName { get; set; }

        /// <summary>
        /// 产品编码
        /// </summary>
        [Display(Name = "产品编码")]
        [MaxLength(100)]
        [Column(TypeName = "varchar(100)")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public string Mass_Incoming_ProCode { get; set; }

        /// <summary>
        /// 规格型号
        /// </summary>
        [Display(Name = "规格型号")]
        [MaxLength(200)]
        [Column(TypeName = "nvarchar(200)")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public string Mass_Incoming_ProModel { get; set; }

        /// <summary>
        /// 本次接收数量
        /// </summary>
        [Display(Name = "本次接收数量")]
        [Column(TypeName = "int")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public int? Mass_Incoming_ReciveNumber { get; set; }

        /// <summary>
        /// 本次检验数量
        /// </summary>
        [Display(Name = "本次检验数量")]
        [Column(TypeName = "int")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public int? Mass_Incoming_CheckNumber { get; set; }

        /// <summary>
        /// 不合格数量
        /// </summary>
        [Display(Name = "不合格数量")]
        [Column(TypeName = "int")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public int? Mass_Incoming_DisStandNumber { get; set; }

        /// <summary>
        /// 来料日期
        /// </summary>
        [Display(Name = "来料日期")]
        [Column(TypeName = "date")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public DateTime? Mass_Incoming_StartDate { get; set; }

        /// <summary>
        /// 检测日期
        /// </summary>
        [Display(Name = "检测日期")]
        [Column(TypeName = "date")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public DateTime? Mass_Incoming_CheckDate { get; set; }

        /// <summary>
        /// 检测结果
        /// </summary>
        [Display(Name = "检测结果")]
        [MaxLength(100)]
        [Column(TypeName = "varchar(100)")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public string Mass_Incoming_Result { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [Display(Name = "备注")]
        [MaxLength(1000)]
        [Column(TypeName = "nvarchar(1000)")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public string Mass_Incoming_Remark { get; set; }

        /// <summary>
        /// 创建人编号
        /// </summary>
        [Display(Name = "创建人编号")]
        [Column(TypeName = "int")]
        [Editable(true)]
        public int? CreateID { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        [Display(Name = "创建人")]
        [MaxLength(30)]
        [Column(TypeName = "nvarchar(30)")]
        [Editable(true)]
        public string Creator { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Display(Name = "创建时间")]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        public DateTime? CreateDate { get; set; }

        /// <summary>
        /// 修改人编号
        /// </summary>
        [Display(Name = "修改人编号")]
        [Column(TypeName = "int")]
        [Editable(true)]
        public int? ModifyID { get; set; }

        /// <summary>
        /// 修改人
        /// </summary>
        [Display(Name = "修改人")]
        [MaxLength(30)]
        [Column(TypeName = "nvarchar(30)")]
        [Editable(true)]
        public string Modifier { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        [Display(Name = "修改时间")]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        public DateTime? ModifyDate { get; set; }

        [Display(Name = "来料检验单-检验项")]
        [ForeignKey("Mass_Incoming_ID")]
        public List<Mass_Incoming_DetItems> Mass_Incoming_DetItems { get; set; }
    }
}
